package com.atguigu.vo;

import com.atguigu.pojo.Cart;
import com.atguigu.pojo.Product;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class CartVo {

    private Integer id;

    private Integer productID;

    private String productName;

    private String productImg;

    private Double price;

    // 购物车中对应商品数量
    private Integer num;

    // 库存量
    private Integer maxNum;

    // 勾选状态
    private Boolean check;

    public CartVo(Product product, Cart cart){
        this.id = cart.getId();
        this.productID = product.getProductId();
        this.productName = product.getProductName();
        this.productImg = product.getProductPicture();
        this.price = product.getProductSellingPrice();
        this.num = cart.getNum();
        this.maxNum = product.getProductNum();
        this.check = false;
    }
}
